package com.dyson.pool;

import com.dyson.pool.testDbPool.service.LogService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/*@SpringBootApplication
public class SiteApplication extends SpringBootServletInitializer {
    //外部tomcat 调整springboot 入口
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SiteApplication.class);
    }
    //仅内部tom 可用, 现已废弃
    public static void main(String[] args) {
        SpringApplication.run(SiteApplication.class, args);
    }
}*/
@SpringBootApplication
public class DbPoolApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(DbPoolApplication.class, args);
        LogService logService = (LogService) applicationContext.getBean("logService");
        System.out.println(logService.logTest());
    }
}
